<?php
	function GetRadioXML(){
		$url = "http://91.121.71.177:8200/song.xsl";
    $ch = curl_init ($url) ;
    curl_setopt ($ch, CURLOPT_RETURNTRANSFER, 1) ;
    $res = curl_exec ($ch) ;
    curl_close ($ch) ;
    return ($res) ;
	}
	$xml= GetRadioXML();
	$mparray = array();
	$sxml = new SimpleXMLElement($xml);
	foreach ($sxml->source as $source) {
		if ($_REQUEST['debug']) print_r($source);
		//if ((($mount) && ($source->mount == "/live")) || !$mount) {
		if (($source->mount == "/live.ogg" && $source->song) || 
		(($mount !="/live.ogg")&&($source->mount == "/nonstop.ogg"))) {
			$radiomount = $source->mount;
			$radioartist = $source->artist;
			$radiosong  = $source->song;
			$radiodesc  = $source->desc;
			$radiotitle = $source->title; 
		} 
	}
	if ($radioartist) $radiosong = "$radioartist - $radiosong";
	$SITE_SONG = "<b>$radiotitle</b><br><i>$radiodesc</i><br>$radiosong";
?>
